

if( TS2HelpPanel ) then
	
	TS2HelpPanel:Remove();

end
TS2HelpPanel = nil;

HelpSelectedLink = 1;

function ShowHelp()

	if( TS2HelpPanel and TS2HelpPanel:IsVisible() ) then
	
		TS2HelpPanel:Remove();
		HideMouse();
		return;
	
	end

	gui.EnableScreenClicker( true );

	TS2HelpPanel = CreateBPanel( "VeniScript 2 Help", 0, 0, 800, 600 );
	
	TS2HelpPanel:SetBodyColor( Color( 50, 50, 50, 100 ) );
	
	TS2HelpPanel.LeftPane = CreateBPanel( nil, 5, 0, 200, 570 );
	TS2HelpPanel.LeftPane:SetParent( TS2HelpPanel );
	TS2HelpPanel.LeftPane:SetBodyColor( Color( 30, 30, 30, 240 ) );
	TS2HelpPanel.LeftPane.Links = { }
	
	local function CreateRightPane()
	
		if( TS2HelpPanel.RightPane ) then
			TS2HelpPanel.RightPane:Remove();
		end
	
		TS2HelpPanel.RightPane = CreateBPanel( nil, 210, 0, 580, 570 );
		TS2HelpPanel.RightPane:SetParent( TS2HelpPanel );
		TS2HelpPanel.RightPane:EnableScrolling( true )
		TS2HelpPanel.RightPane:SetBodyColor( Color( 30, 30, 30, 240 ) );
		
	end
	
	local colour = Color( 80, 80, 255, 255 )
	
	if( TS.Christmas ) then	
		colour = Color( 0, 255, 0, 255 )	
	end	
	
	for n = 1, #TS2HelpOptions do
	
		TS2HelpPanel.LeftPane.Links[n] = TS2HelpPanel.LeftPane:AddLink( TS2HelpOptions[n].Name, "NewChatFont", 3, 5 + ( n - 1 ) * 14, Color( 255, 255, 255, 200 ), function() CreateRightPane(); TS2HelpPanel.LeftPane.Links[HelpSelectedLink].NormalColor = Color( 255, 255, 255, 200 ); TS2HelpPanel.LeftPane.Links[n].NormalColor = Color( 80, 80, 255, 200 ); HelpSelectedLink = n; TS2HelpPanel.RightPane.PaintHook = nil; TS2HelpOptions[n].Func(); end, Color( 200, 200, 200, 200 ) );
		TS2HelpPanel.LeftPane.Links[n].HighlightColor = colour
		
	end
	
	TS2HelpPanel.LeftPane.Links[1].Action();
	
	TS2HelpPanel.OnClose = function()
	
		HideMouse();
	
	end

end
usermessage.Hook( "SH", ShowHelp );

function Help_Info()

	local colour = Color( 255, 0, 0, 255 )
	
	if( TS.Christmas ) then	
		colour = Color( 0, 255, 0, 255 )	
	end

	TS2HelpPanel.RightPane.PaintHook = function()
	
		draw.DrawTextOutlined( "T", "GModToolName", 5, 5, Color( 255, 0, 0, 255 ), nil, nil, 2, Color( 0, 0, 0, 255 ) );
		draw.DrawTextOutlined( "aco", "GModToolName", 25, 5, Color( 255, 255, 255, 255 ), nil, nil, 2, Color( 0, 0, 0, 255 ) );
		draw.DrawTextOutlined( "S", "GModToolName", 95, 5, Color( 255, 0, 0, 255 ), nil, nil, 2, Color( 0, 0, 0, 255 ) );
		draw.DrawTextOutlined( "cript", "GModToolName", 123, 5, Color( 255, 255, 255, 255 ), nil, nil, 2, Color( 0, 0, 0, 255 ) );
		draw.DrawTextOutlined( "2", "GModToolName", 215, 5, Color( 255, 0, 0, 255 ), nil, nil, 2, Color( 0, 0, 0, 255 ) );
		draw.DrawText( "Created by Rick Dark", "NewChatFont", 250, 28, Color( 255, 255, 255, 255 ) );
		
	end
	
	TS2HelpPanel.RightPane:AddLabel( "Welcome to PubGamer HL2RP: www.pubgamer.org\nThis is the help menu. We ask that you take this time to read over the contents.\n\nServer Rules:\n\n- No Prop Killing/Surfing/Blocking\n- No Random Killing/Punchwhoring\n- Don't walk around with your phys/grav gun out.\n- Listen to admins.\n- Be Respectful, Kind, and Welcoming.", "NewChatFont", 10, 60, Color( 255, 255, 255, 255 ) );

end

function Help_Credits()

	TS2HelpPanel.RightPane:AddLabel( "TacoScript 2 Credits", "NewChatFont", 10, 10, Color( 255, 0, 0, 255 ) );

	local HelpString = "\n\nRick Dark - Creating/Developing/Scripting\n\n\nSpecial thanks to..\n\n";
	HelpString = HelpString .. "Ixius - For the initial idea of doing TS2, and for the ID card stuff\n";
	HelpString = HelpString .. "Waffler - Additional Coding/Scripting and ripping TS1/Epidemic code.\n";
	HelpString = HelpString .. "FritoMaster - For making Rick Dark the ziptie model\n";
	HelpString = HelpString .. "Various testers - For doing either a bad or decent job of testing the script\n";
	HelpString = HelpString .. "A small select number of people - For having decent ideas for the script\n";
	HelpString = HelpString .. "My ragtag posse - For being cool beans. \n\n";
	HelpString = HelpString .. "Janorkie, Michael, Kermit - Some Scripting\n"
	HelpString = HelpString .. "ReichRP - Some Scripting and ripping of TS1 Code.\n"
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, 10, Color( 255, 255, 255, 255 ) );
	
	TS2HelpPanel.RightPane.CurSprite = 1;
	TS2HelpPanel.RightPane.LastUpdate = CurTime();
	TS2HelpPanel.RightPane.Sprites = {
		":D-<-<",
		":D->-<",
		":D->->",
	};

	TS2HelpPanel.RightPane.PaintHook = function()

		if( CurTime() - TS2HelpPanel.RightPane.LastUpdate > .7 ) then
		
			TS2HelpPanel.RightPane.LastUpdate = CurTime();
			TS2HelpPanel.RightPane.CurSprite = TS2HelpPanel.RightPane.CurSprite + 1;
			
			if( TS2HelpPanel.RightPane.CurSprite >= 4 ) then
				TS2HelpPanel.RightPane.CurSprite = 1;
			end
		
		end

		draw.DrawTextOutlined( TS2HelpPanel.RightPane.Sprites[TS2HelpPanel.RightPane.CurSprite] .. "\n" .. TS2HelpPanel.RightPane.Sprites[TS2HelpPanel.RightPane.CurSprite] .. "\n" .. TS2HelpPanel.RightPane.Sprites[TS2HelpPanel.RightPane.CurSprite] .. "\n" .. TS2HelpPanel.RightPane.Sprites[TS2HelpPanel.RightPane.CurSprite] .. "\n", "GiantDanceTargetID", 25, 320, Color( 180, 0, 180, 255 ), nil, nil, 2, Color( 0, 0, 0, 255 ) );

	end


end

function Help_Chatting()

	local HelpString = "Information on OOC/IC chatting.\n\n";
	HelpString = HelpString .. "In-Character:\n\n";
	HelpString = HelpString .. "/w - Whisper\n/y - Yell\n/me - Narrate your action\n/it - Narrate your surroundings\n[[ or .// - Local OOC\n/r Radio chat if you have radio, there are variations of radio yell(/ry) and whisper(/rw)\n/adv - Advertise something for 25 credits\n\n";
	
	HelpString = HelpString .. "Out-Of-Character:\n\n";
	HelpString = HelpString .. "// or /a or /ooc - Talk in OOC chat.  Note, OOC delays can prohibit this.";
	
	HelpString = HelpString .. "Important:\n\n";
	HelpString = HelpString .. "Always follow the Out-Of-Character Rule!\nDo not mix up IC and OOC or you will be banned!";
	
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, 10, Color( 255, 255, 255, 255 ) );
		

end

function Help_Animations()

	local HelpString = "TacoScript 2 has a list of special animations/poses that players can use.  Note, many animations are only usable for certain player models and teams.  Most only usable on male citizens due to HL2 model limitations.\n\nThese animations can be toggled by doing them twice, some can be untoggled using the chat command /stand\n\n";
	HelpString = HelpString .. ")  Sitting - Only citizen models can use these.  To sit, back up to a chair or bench, and get as close as you can to it but do NOT get on top of it.  With your back towards whatever you're wanting to sit on, type in chat /sit or use rp_ic_sit.  There are 4 sitting animations available, so you can specify what type of animation you want by following the command with a number, such as /sit 3 or rp_ic_sit 4. You cannot sit in all seats.\n\n";
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	HelpString = HelpString .. ")  Sitting on the ground - Only citizen models can use these.  To sit on the ground, just use /sitground or rp_ic_sitground.  There are 2 ground sitting animations you can use, which you can access by following the command by a number, such as /sitground 2.\n";

	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, 10, Color( 255, 255, 255, 255 ) );
	
	HelpString = "";
	HelpString = HelpString .. ")  Lean against wall - Only citizen models can use this.  This animation is normally used for when trying to look cool.  Just put your back against a wall and do /lean or use console command rp_ic_lean.\n\n";
	
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, nil, Color( 255, 255, 255, 255 ) );
	
	HelpString = "";
	HelpString = HelpString .. ") Knocking and Pushing - This is CP only, use rp_ic_cpknock to knock on a door and rp_ic_cppush to push someone."
	
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, nil, Color( 255, 255, 255, 255 ) );
	
end

function Help_Commands()

	local HelpString = "Information on console commands used in TS2.\n\n";
	HelpString = HelpString .. "rp_toggleholster - Holster/unholster your weapon.\n";
	HelpString = HelpString .. "rp_userlist - Get a list of the server's players and their SF/RP names and SteamID\n";
	HelpString = HelpString .. "rp_changename - 'rp_changename [name]' Change your current name.\n";
	HelpString = HelpString .. "rp_motd - See MOTD.  Can also be accessed via F3.\n\n";
	HelpString = HelpString .. "rp_cl_ts1hud <1 or 0> - Toggles TS1-style HUD bars.\n\n";
	HelpString = HelpString .. "rp_cl_cphud <1 or 0> - Toggles CP Overlay.\n\n";
	HelpString = HelpString .. "gm_showhelp - F1 key.\n";
	HelpString = HelpString .. "gm_showteam - F2 key.\n";
	HelpString = HelpString .. "gm_showspare1 - F3 key.\n";
	HelpString = HelpString .. "gm_showspare2 - F4 key.\n";
	HelpString = HelpString .. "rp_listcpvoices/rp_emit <id> - Look at current sounds for civil protection and emit them.\n";
	HelpString = HelpString .. "rp_listvoices/rp_playsound <id> - Look at current sounds for humans and emit them.\n";
	HelpString = HelpString .. "eng_openbm/eng_opencb - Open Blackmarket or Contraband menu if you have flags.\n";

	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, 10, Color( 255, 255, 255, 255 ) );
	

end

function Help_PropOwnership()

	local HelpString = "To interact with properties or doors, simply press F4 on them and a small menu will pop up.\n\n";
	HelpString = HelpString .. ") To own properties, press F4 on the front door of an unowned property.  You may be given a menu with options of how long you want to rent the property.  When the time is up on renting a property, your ownership will be revoked unless you re-rent it.\n\n";
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, nil, Color( 255, 255, 255, 255 ) );
	

end

function Help_TS2Dummies_Gettingstarted()

	local HelpString = "\nFirst off I just want to say, Welcome To Your New Addiction! Yes, although HL2 RP is just a way to do the stuff in real life on a computer game, it is very addicting for many reasons. Since you are reading this, you are probably not the average new person. Congratulations, you now are on your way to becoming a serious roleplayer, which is fun for everyone! Let's get started.\n\nSo we know you already have a character, but the chances are you really didn't put a story into the name and identity of this man/woman. So we are going to start from scratch, don't worry about your tokens, they arn't that important, but we'll talk about them in a bit. So let's create your new character. First, a name, examples of good names:\n\nStephan Mac Wild\nHank Froundlan\nMichael Bird\n\nStay away from using nicknames as the first name, think of this as naming a child. Bad names:\n\nBob Butts\nBen Dover\nSteve\nwill\n\""	
	HelpString = HelpString .. "Yes, people actually do that. So once you have chosen a name, age, sex, then your looks. Choose wisely, remember people see this\npart of you character first, my first character was bald so I was called skinhead, great opportunity for him to develop anger, but we will talk about Character Development later. No you can finally enter your bio, why is this important? Let's get yourself familiar with your new character's background. Is s/he a child of the war, or was s/he born before the war? Describe what in this person's life is most important, like I will show you my character's backstory:\n\n______\nDerek Dunnar\nDerek resided in Blok Burrow, a small town a few kilometers from where City 18 now stands. Derek refused to take on a role against the Combine durring the war. He complied and followed in the Combine's footsteps. He now resides in City 18, in his dirty little apartment, enlightend by the fact that compliance offered him better life. He eagerly awaits the Greater Good, hoping that one day he can join the ranks of the Metro Police Force...\n______\n\nAlright, I am sure you got the point. Have fun and be creative, it gives you the excuses to act viciously, idioticly, seriously, or whatever. And remeber, even though you man not want him/her to, she WILL change because of what happens. Now, lets get you familiar with the importance of some of the chat commands. First off bind rp_toggleholster to your 'x' key, or what ever key you like, to do this, press ~ to enter console and type <bind \"x\" \"rp_toggleholster\"> , ignore the < > . Now since we are in the console, lets bind a few simple phrases. I have bound my name and CID for ration distribution like this <bind \"8\" \"say Derek Dunnar, 69074\"> it makes the ration distribution go alot quicker. I also bound one of the phrases you will say most... 'Yes, sir.' So bind whatever you want.\n\nAnother important console command is '+duck' use this command to stay in a crouched position and not have to hold the crouch button down, to get out \"-duck\". So now lets get familiar with the chat commands.\n\n// - Out Of Charater, chances are, if someone hasn't either put the delay at a rediculously high amount, they will if you abuse this chatcommand, EVERYONE can see it and it is OOC.\n\n.// - Local Out Of Character, only the people close to you can see what this says, there is no delay for this command.\n\n/passout - Passout, this will knock your character out untill you type /getup when prompted.\n\n/me - Ignoring the space between '/' and 'me'. Action, is seen as \"[Character Name] [Action]\" Example: \"/me sips from his galss of water.\" is seen as \"Derek Dunnar sips from his glass of water.\"\n\n!a - Communicate to the Admins. DO NOT say rondom things using !a, you will get stabbed in your sleep... and then banned.\n\nSo now that you are familiar with the basics, go forth and have fun.. but not before you finish with the rest of this.\n\n"
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, nil, Color( 255, 255, 255, 255 ) );

end
function Help_TS2Dummies_Forums()

	local HelpString = "\n - pubgamer.org\n\nThis place is VERY important. Here is where the announcments are made, donations are made, where you start your reputation, and where you apply for the various roleplaying groups such as the MPF. Check the forums EVERYDAY is you want to be an active member... unless you're just too cool for us... then... go away.";
	
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, nil, Color( 255, 255, 255, 255 ) );
	

end


function Help_Donations()
TS2HelpPanel.RightPane:AddLabel( "The PubGamer Team + Donations", "NewChatFont", 10, 10, Color( 255, 0, 0, 255 ) );

	TS2HelpPanel.RightPane:AddLabel( "The PubGamer Administrators", "NewChatFont", 10, 60, Color( 21, 153, 255, 255 ) );
	local HelpString = "\n\n- Waffler - Scripting and Development\n\n\n- Michael - Executive Administrator\n\n- Stealthpaw - Head Administrator\n\n- Silent - Super Admin\n- Dean - Super Admin\n\n- Amarius - Senior Admin\n- OzJackal - Senior Admin\n- SatN - Senior Admin\n- Hunter - Senior Admin\n\n- DannN - Basic Admin\n- Kermit - Basic Admin\n- Luke - Basic Admin\n- The General - Basic Admin\n\n\n\n List of donation benefits\n\n- Ragdoll Access - $10\n- Effect Access - $10\n- Ragdoll and Effect access - $10\n- Contraband Flag - $8\n- Duplicator Access - $5\n- Private/Public Subforum - $10\n- Tool Trust - $10\n- Event Access - $5\n- Custom User Description on Forum - $5\n- Custom Model - $10\n\n Tokens\n- $5 - 5000 token\n- $10 - 10000 tokens\n- $15 - 15000 tokens\n- $20 - 20000 tokens\n- $30 - 40 thousand tokens\n\n Please contact Michael by adding Acerman1254 on Steam about donating\n or head to www.pubgamer.org and put your Steam friends username in the description\n\n King Regards\n PubGamer Administration\n\n\n\n"
	HelpString = FormatLine( HelpString, "NewChatFont", 570 );
	TS2HelpPanel.RightPane:AddLabel( HelpString, "NewChatFont", 10, nil, Color( 255, 255, 255, 255 ) );
	

end

TS2HelpOptions = {

	{ Name = "- Information", Func = Help_Info },
	{ Name = "- Credits", Func = Help_Credits },
	{ Name = "- TacoScript 2", Func = function() end },
	{ Name = "   * Chatting", Func = Help_Chatting },
	{ Name = "   * Console", Func = Help_Commands },
	{ Name = "   * Animations", Func = Help_Animations },
	{ Name = "   * Doors/Properties", Func = Help_PropOwnership },
	{ Name = "- Guides", Func = function() end },
	{ Name = "   - HL2RP RP for dummies", Func = function() end },
	{ Name = "      * 1. Getting started", Func = Help_TS2Dummies_Gettingstarted },
	{ Name = "      * 2. The Forums", Func = Help_TS2Dummies_Forums },
	{ Name = "- The Team and Donations", Func = Help_Donations },

}

